'''
Created on Dec 1, 2010

@author: behrooz
'''

import random
import string
import uuid

def generate_key(length=7):
    key = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(length))
    return key

def generate_uuid1():
    id = uuid.uuid1()
    return id, id.hex